/**
 * Licensee: Universidad de Almeria
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateAgendaRMI2Data {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = orm.AgendaRMI2PersistentManager.instance().getSession().beginTransaction();
		try {
			orm.Registro lormRegistro = orm.RegistroDAO.createRegistro();
			// Initialize the properties of the persistent object
			orm.RegistroDAO.save(lormRegistro);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateAgendaRMI2Data createAgendaRMI2Data = new CreateAgendaRMI2Data();
			try {
				createAgendaRMI2Data.createTestData();
			}
			finally {
				orm.AgendaRMI2PersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
